<?php

class Form_SalesTrends extends Zend_Form
{

    public function init()
    {
    	$id = new Zend_Form_Element_Hidden("id");
        $id->setValue(0);
        $id->setRequired(true);
        $idValidator = new Zend_Validate_Int();
        $id->addValidator($idValidator);
        $this->addElement($id, "id");
        
        $artist = new Zend_Form_Element_Select("artist");
        $artist->setLabel("艺术家: ");
        $artist->setRequired(true);
        
    	$table = new Model_DbTable_Artist();
        $artists = $table->fetchAll(null, "name ASC");
        foreach ($artists as $theArtist){
        	$artist->addMultiOption($theArtist->id, $theArtist->name);
        }
        
        $this->addElement($artist, "artist");
        
        
        $order = new Zend_Form_Element_Text("order");
        $order->setLabel("显示顺序: ");
        $order->setValue(0);
        $this->addElement($order, "order");
        
        
        $trends = new Zend_Form_Element_Radio("trends");
        $trends->setLabel("趋势: ");
        $trends->addMultiOption('U', "上升");
        $trends->addMultiOption('D', "下降");
        $trends->setValue('U');
        $this->addElement($trends, "trends");
        
        
        
        $submit = new Zend_Form_Element_Submit("submit");
        $this->addElement($submit, "submit");
    }


}

